package com.ft.springboottravel.mapper;

import com.ft.springboottravel.bean.Shop;
import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper
public interface ShopMapper {
    //查询全部
    @Select("select * from shop")
    List<Shop> SelectShopList();
    //根据id查询单个
    @Select("select * from shop where shop_id = #{shopId}")
    Shop SelectShopId(Integer shop_id);
    //多条件查询
    List<Shop> SelMultiShopList(@Param("currentPage") Integer currentPage,@Param("shopName")String shopName,@Param("shopTel") String shopTel,@Param("shopAddress") String shopAddress);
    //查询总条数
    Long getShopTotal(@Param("shopName")String shopName,@Param("shopTel") String shop_tel,@Param("shopAddress") String shopAddress);
    //添加shop
    @Insert("insert into shop values(0,#{shopName},#{shopTel},#{shopAddress})")
    void AddShop(Shop shop);
    //删除shop
    @Delete("delete  from shop where shop_id = #{shopId}")
    void DelShopById(Integer shop_id);
    //修改shop
    @Update("update shop set shop_name=#{shopName},shop_tel=#{shopTel},shop_address=#{shopAddress} where shop_id=#{shopId}")
    void EditShop(Shop shop);

}
